function lb() {
    var btns = document.getElementsByClassName("c1"),
        imgs = document.getElementsByClassName("i1"),
        lis = document.getElementsByClassName("l1"),
        j = 0;//关键点：计数器
    console.log(lis);
    for (var i in btns) {
        btns[i].onclick = function () {
            if (this.innerText == ">") {
                j++;
                j == 4 && (j = 0);
                cleal()
            } else {
                j--;
                j == -1 && (j = 3);
                cleal()
            }
        }
    }
    for (var i = 0; i < lis.length; i++) {
        lis[i].onclick = function () {
            console.log(1);
            j = parseInt(this.getAttribute("dy"))
            cleal()
        }
    }

    timer = setInterval(() => {
        j++;
        j == 4 && (j = 0);
        cleal()

    }, 3000);
    var car = document.getElementsByClassName("carousel")[0];
    console.log(car);
    car.onmouseover = function () {
        clearInterval(timer);
    }
    car.onmouseout = function () {
        clearInterval(timer);
        timer = setInterval(() => {
            j++;
            j == 4 && (j = 0);
            cleal()
        }, 3000);
    }

    function cleal() {

        for (var i = 0; i < lis.length; i++) {
            imgs[i].className = "i1"
            lis[i].className = "l1"
        }
        imgs[j].className = "active i1"
        lis[j].className = "active l1"
    }

}
lb()




var map = new BMapGL.Map("container");
var point = new BMapGL.Point(106.55778, 29.576332);
map.centerAndZoom(point, 15);
// 创建点标记
var marker = new BMapGL.Marker(point);
map.addOverlay(marker);
// 创建信息窗口
var opts = {
    width: 200,
    height: 100,
    title: '漫咖啡'
};
var infoWindow = new BMapGL.InfoWindow('地址：重庆市江北区北滨一路龙湖星悦荟11区内', opts);
// 点标记添加点击事件
marker.addEventListener('click', function () {
    map.openInfoWindow(infoWindow, point); // 开启信息窗口
});









